#version 320 es

//着色器语言标准 参考 https://www.khronos.org/registry/OpenGL/specs/es/3.1/GLSL_ES_Specification_3.10.pdf

//gl es 3.1的精度标准：highp:32bit, mediump:16~32bit, lowp:9~32位
precision highp float; //gl es要求显式定义 默认float类型精度

//float 对应samplerXX, unsigned interger 对应 usamplerXX, signed interger 对应 isamplerXX
layout(location = 0) uniform highp usampler2D tex_input;

layout(location = 20) uniform highp float multi_alpha;
layout(location = 21) uniform highp float add_beta;

//  输出也要与 线定Attachment的纹理类型相同， vecx -> float, uvecx -> unsigned int, ivecx-> signed int
layout(location = 0) out highp vec4 FragColor;
layout(location = 1) out highp uvec4 uFragColor;
layout(location = 2) out highp ivec4 iFragColor;
void main()
{
    vec4 value = vec4(texelFetch(tex_input,ivec2(gl_FragCoord.xy),0));//;texture(tex_input,texpos);
    value = multi_alpha * value + add_beta;// vec4(value)/255.0f;
    FragColor = vec4(intBitsToFloat(textureSize(tex_input,0).y));//value;  //
    uFragColor = uvec4(textureSize(tex_input,0).x / 8);  //gl_FragCoord.y
    iFragColor = ivec4(gl_FragCoord.x);
}
